
$(function(){
	nameInput();
});

$(document).on("click",".featured .swiper-slide",function(){ 		
	var divs=JSON.parse($(this).attr("data"));
	$(".tabs-line a").eq(0).addClass("active").siblings().removeClass("active");
	$("#open1 .tabSwiper .swiper-wrapper .swiper-slide").eq(0).addClass("swiper-slide-active").siblings().removeClass("swiper-slide-active");
	$("#open1 .tabSwiper .swiper-wrapper").css({"transform":" translate3d(0px, 0px, 0px)","transition-duration": "0s"});
	var params={"pkgId":divs.pkgId, "sign":divs.sign,"allowSaling":divs.allowSaling};

	if($("#leftTabBox")){
	 TouchSlide({ slideCell:"#leftTabBox" });
	};
	$("#benefitimg").attr("src","");
	$("#featureimg").attr("src","");
	$("#tbsl img").attr("src",'');
padMarketing.ajaxNormal(
	'/pad_marketing/main/type003getDecall.action',
	params,
	function(data){
		$('#title').attr('datas',JSON.stringify(data));				
		$("#title").html(data.title);
		$("#subTitle").html("  (投保年龄："+data.subTitle+")");
		$("#benefit").html(data.benefit);
		$("#feature").html(data.feature);
		$("#benefitimg").attr("src","/portal/resources/images/product/packages/"+ data.pkgId +"/CPTS.jpg");
		$("#featureimg").attr("src","/portal/resources/images/product/packages/"+ data.pkgId +"/LYJJ.jpg");
		$("#tbsl img").attr("src",'/portal/resources/images/product/packages/'+ data.pkgId +'/TBSL.jpg');		
		var url=sessionStorage.allUrl;
		var come=sessionStorage.comePro;
		if(url){
			if(come){
				
			}else{
				$("#proButton").hide();
				$("#proButton").parent().removeClass('col-md-offset-3').addClass('col-md-offset-1');
			}
		}
	},
	function(data){
		//alert(JSON.stringify(data));
		
	}
);
})
function close(){
	var age = $("#inputAge").val();
	var re = /^\d*$/;
	if(!re.test(age)){
		alertMsg("请正确输入年龄");
		return;
	}else{
		closeDiv('open3');
	}
}